<?php
/**
 * Created by PhpStorm.
 * User: testypp
 * Date: 2017/12/18
 * Time: 下午2:39
 */

class Domain_User {

    // 根据ID获得User Info
    public function getUserByID($userId) {
        $rs = array();

        $userId = intval($userId);
        if ($userId <= 0) {
            return $rs;
        }

        $model = new Model_User();
        $rs = $model->getUserByID($userId);

        return $rs;
    }

    // 根据Mobile获得User Info
    public function getUserByMobile($mobile) {
        $rs = array();

        $userId = intval($mobile);
        if ($userId <= 0) {
            return $rs;
        }

        $model = new Model_User();
        $rs = $model->getUserByMobile($mobile);

        return $rs;
    }

    // 用户注册
    public function addUser($mobile, $password, $nickname) {
        $rs = array();

        $model = new Model_User();

        $rs = $model->addUser($mobile, $password, $nickname);

        return $rs;
    }

    // 用户登录
    public function loginUser($mobile, $password) {
        $rs = array();

        $model = new Model_User();
        $rs = $model->loginUser($mobile, $password);

        return $rs;
    }


}